<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    {if $auth->city_id == 0}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">城市:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-city_id" class="form-control" name="row[city_id]" data-rule="required">
                <option value="">选择</option>
                {foreach name="cityArr" item="v"}
                <option value="{$key}">{$v}</option>
                {/foreach}
            </select>
        </div>
    </div>
    {/if}

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">商品分类:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-category_id" class="form-control" name="row[category_id]" data-rule="required">
                <option value="">选择</option>
                {if $auth->city_id > 0}
                {foreach name="categoryArr" item="v"}
                <option value="{$key}">{$v}</option>
                {/foreach}
                {/if}
            </select>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required;length(~50)" class="form-control" name="row[name]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Short_name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-short_name" data-rule="required;length(~30)" class="form-control" name="row[short_name]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Description')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-description" data-rule="required;length(~250)" class="form-control" name="row[description]" rows="5"></textarea>
        </div>
    </div>
    <div class="form-group">
        <label for="c-images" class="control-label col-xs-12 col-sm-2">商品图片:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-images" data-rule="required" class="form-control" size="50" name="row[pic]" type="text" readonly value="">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-images" class="btn btn-danger plupload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg" data-url="xajax/uppic/group/goods" data-maxsize="10M" data-multiple="false" data-preview-id="p-images"><i class="fa fa-upload"></i> 上传</button></span>
                </div>
                <span class="msg-box n-right" for="c-pics"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-images"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">商品原价:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-original_price" class="form-control" step="0.01" name="row[original_price]" type="number" placeholder="可不填" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">商品销售价:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-price" data-rule="required" class="form-control" step="0.01" name="row[price]" type="number" value="0.00">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Box_fee')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-box_fee" data-rule="required" class="form-control" step="0.01" name="row[box_fee]" type="number" value="0.00">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">销售开始:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-sale_start" data-rule="开始时间: required;datetime;" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[sale_start]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">销售结束:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-sale_end" data-rule="结束时间: required;datetime;match(gte, row[sale_start], datetime)" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[sale_end]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Limit_num')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-limit_num" data-rule="required" class="form-control" name="row[limit_num]" type="number" value="0">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('At_least')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-at_least" data-rule="required" class="form-control" name="row[at_least]" type="number" value="1">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">商品类型:</label>
        <div class="col-xs-12 col-sm-8">

            <div class="radio">
                <label for="row[type]-0"><input id="row[type]-0" name="row[type]" type="radio" value="1" checked /> 套餐</label>
                <label for="row[type]-1"><input id="row[type]-1" name="row[type]" type="radio" value="2" /> 单品</label>
            </div>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">单独售卖:</label>
        <div class="col-xs-12 col-sm-8">

            <div class="radio">
                <label for="row[is_alone_sale]-0"><input id="row[is_alone_sale]-0" name="row[is_alone_sale]" type="radio" value="0" checked /> 不可以</label>
                <label for="row[is_alone_sale]-1"><input id="row[is_alone_sale]-1" name="row[is_alone_sale]" type="radio" value="1" /> 可以</label>
            </div>

        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            
            <div class="radio">
            {foreach name="statusList" item="vo"}
            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="0"}checked{/in} /> {$vo}</label> 
            {/foreach}
            </div>

        </div>
    </div>
    <div class="form-group layer-footer">
        <div class="text-center">
            <button type="submit" class="btn btn-success btn-embossed disabled">提交</button>
            <button type="button" class="btn btn-primary btn-embossed btn-close" onclick="Layer.closeAll();">关闭</button>
        </div>
    </div>
</form>
